import * as constant from './constant'
import axios from 'axios'
const getTitleList = ( result ) => ({
    type: constant.GET_TITLE_LIST,
    writerList: result.writerList
})
export const getTitleData = () => {
    return (dispatch) => {
        axios.get('/api/home.json').then((res) => {
            const result = res.data.data;
            dispatch( getTitleList(result) );
        })
    }
}